package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FeeRecordMapper;
import com.ruoyi.system.domain.FeeRecord;
import com.ruoyi.system.service.IFeeRecordService;

/**
 * 费用记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-28
 */
@Service
public class FeeRecordServiceImpl implements IFeeRecordService 
{
    @Autowired
    private FeeRecordMapper feeRecordMapper;

    /**
     * 查询费用记录
     * 
     * @param recordId 费用记录主键
     * @return 费用记录
     */
    @Override
    public FeeRecord selectFeeRecordByRecordId(Long recordId)
    {
        return feeRecordMapper.selectFeeRecordByRecordId(recordId);
    }

    /**
     * 查询费用记录列表
     * 
     * @param feeRecord 费用记录
     * @return 费用记录
     */
    @Override
    public List<FeeRecord> selectFeeRecordList(FeeRecord feeRecord)
    {
        return feeRecordMapper.selectFeeRecordList(feeRecord);
    }

    /**
     * 新增费用记录
     * 
     * @param feeRecord 费用记录
     * @return 结果
     */
    @Override
    public int insertFeeRecord(FeeRecord feeRecord)
    {
        feeRecord.setCreateTime(DateUtils.getNowDate());
        return feeRecordMapper.insertFeeRecord(feeRecord);
    }

    /**
     * 修改费用记录
     * 
     * @param feeRecord 费用记录
     * @return 结果
     */
    @Override
    public int updateFeeRecord(FeeRecord feeRecord)
    {
        feeRecord.setUpdateTime(DateUtils.getNowDate());
        return feeRecordMapper.updateFeeRecord(feeRecord);
    }

    /**
     * 批量删除费用记录
     * 
     * @param recordIds 需要删除的费用记录主键
     * @return 结果
     */
    @Override
    public int deleteFeeRecordByRecordIds(Long[] recordIds)
    {
        return feeRecordMapper.deleteFeeRecordByRecordIds(recordIds);
    }

    /**
     * 删除费用记录信息
     * 
     * @param recordId 费用记录主键
     * @return 结果
     */
    @Override
    public int deleteFeeRecordByRecordId(Long recordId)
    {
        return feeRecordMapper.deleteFeeRecordByRecordId(recordId);
    }
}
